<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\GoodsModel;
use Illuminate\Support\Facades\DB;
class GoodsController extends Controller
{
    public function goods()
    {
        //
       $goods=GoodsModel::paginate(3);
        
      return view("Admin/Goods/goods")->with("product",$goods);

    }

     public function search(Request $request)
    {
        //
        $search=$request->input("search");

        $list=DB::table('goods')->where('productname','like','%'.$search.'%')->get();
        return redirect("/admin/product");
    }
}
